<template>
  <el-select v-model="name" placeholder="请选择调库单">
    <el-option v-for="item in list" :key="item.id" :label="item.transferSn" :value="val_format(item)" />
  </el-select>
</template>

<script setup lang="ts">
import { computed, onMounted } from "vue";
const { proxy } = getCurrentInstance();
let props = defineProps(["modelValue", "readonly", "val"]);
const emit = defineEmits(["update:modelValue", "fatherMethods"]);
let list = ref([]);

onMounted(() => {
  getInfo();
});
const name = computed({
  get() {
    return props.modelValue;
  },
  set(value: Number) {
    emit("update:modelValue", value);
  },
});

let val_format = (item) => {
  return props.val ? item[props.val] : item.id;
};
let getInfo = async () => {
  let { data } = await proxy.$apis.transferQuery();
  list.value = data;
};
</script>

<style lang="scss" scoped>
</style>
